﻿using System;
using System.Collections.Generic;
using System.Text;
using Abp.AutoMapper;
using FwProject.Core.FactoryInfo;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using FwProject.Core.TypeNumber;

namespace FwProject.TypeNumber.Dto
{
    [AutoMap(typeof(TypeNumberInfo))]
   public class TypeNumberInfoInput
    {
        [Display(Name = "所属工厂")]
        public Guid? FactoryinfoId { get; set; }
        [Required(ErrorMessage ="{0}不能为空")]
        [Display(Name = "所属模块")]
        public ModuleFlag ModuleFlag { get; set; } = ModuleFlag.产品模块;
        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "所属类型")]
        public AttributeFlag AttributeFlag { get; set; } = AttributeFlag.餐厅;
        /// <summary>
        /// 型号名称
        /// </summary>
        /// <value>The name.</value>
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(TypeNumberInfo.StringLength,ErrorMessage = "不能超过{1}个字符")]
        [Display(Name = "名称")]
        public string Name { get; set; }
        /// <summary>
        /// 型号描述
        /// </summary>
        /// <value>The readme.</value>
        [StringLength(TypeNumberInfo.StringLength, ErrorMessage = "不能超过{1}个字符")]
        [Display(Name = "描述")]
        public string Readme { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        /// <value>The order list.</value>
        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name ="排序")]
        public int OrderList { get; set; } = 1;
        /// <summary>
        /// 单位
        /// </summary>
        /// <value>The unit.</value>
        [Required]
        [Display(Name ="单位")]
        public UnitFlag Unit { get; set; } = UnitFlag.套;

        [Display(Name = "数量")]
        public int Count { get; set; }

        [Display(Name = "默认装车型号")]
        public bool IsActive { get; set; } = true;
    }
}
